package ProjectViewer.Window;

public enum Opcode {

	 /*0x00*/ NOP         (0, "nop",         "",    ""),
	 /*0x01*/ ACONST_NULL (0, "aconst_null", "...", "...,null"),
     
	 /*0x02*/ ICONST_M1   (0, "iconst_m1", "...", "<-1>"),
	 /*0x03*/ ICONST_0    (0, "iconst_0",  "...", "<0>"),
	 /*0x04*/ ICONST_1    (0, "iconst_1",  "...", "<1>"),
	 /*0x05*/ ICONST_2    (0, "iconst_2",  "...", "<2>"),
	 /*0x06*/ ICONST_3    (0, "iconst_3",  "...", "<3>"),
	 /*0x07*/ ICONST_4    (0, "iconst_4",  "...", "<4>"),
	 /*0x08*/ ICONST_5    (0, "iconst_5",  "...", "<5>"),
	 
	 /*0x09*/ LCONST_0    (0, "lconst_0",  "...", "<0>"),
	 /*0x0a*/ LCONST_1    (0, "lconst_1",  "...", "<1>"),
	 
	 /*0x0b*/ FCONST_0    (0, "fconst_0",  "...", "...,<0.0>"),
	 /*0x0c*/ FCONST_1    (0, "fconst_1",  "...", "...,<1.0>"),
	 /*0x0d*/ FCONST_2    (0, "fconst_2",  "...", "...,<2.0>"),
	 /*0x0e*/ DCONST_0    (0, "dconst_0",  "...", "...,<0.0>"),
	 /*0x0f*/ DCONST_1    (0, "dconst_1",  "...", "...,<1.0>"),
	 
	 /*0x10*/ BIPUSH      (1, "bipush",    "...", "...,value"),
	 /*0x11*/ SIPUSH      (2, "sipush",    "...", "...,value"),
	 /*0x12*/ LDC         (1, "ldc",       "...", "...,value"),
	 /*0x13*/ LDC_W       (2, "ldc_w",     "...", "...,value"),
	 /*0x14*/ LDC2_W      (2, "ldc2_w",    "...", "...,value"),
	 /*0x15*/ ILOAD       (1, "iload",     "...", "...,value"),
	 /*0x16*/ LLOAD       (1, "lload",     "...", "...,value"),
	 /*0x17*/ FLOAD       (1, "fload",     "...", "...,value"),
	 /*0x18*/ DLOAD       (1, "dload",     "...", "...,value"),
	 /*0x19*/ ALOAD       (1, "aload",     "...", "...,objectref"),

	 /*0x1a*/ ILOAD_0     (0, "iload_0",   "...", "...,value"),
	 /*0x1b*/ ILOAD_1     (0, "iload_1",   "...", "...,value"),
	 /*0x1c*/ ILOAD_2     (0, "iload_2",   "...", "...,value"),
	 /*0x1d*/ ILOAD_3     (0, "iload_3",   "...", "...,value"),

	 /*0x1e*/ LLOAD_0     (0, "lload_0",   "...", "...,value"),
	 /*0x1f*/ LLOAD_1     (0, "lload_1",   "...", "...,value"),
	 /*0x20*/ LLOAD_2     (0, "lload_2",   "...", "...,value"),
	 /*0x21*/ LLOAD_3     (0, "lload_3",   "...", "...,value"),
     
	 /*0x22*/ FLOAD_0     (0, "fload_0",   "...", "...,value"),
	 /*0x23*/ FLOAD_1     (0, "fload_1",   "...", "...,value"),
	 /*0x24*/ FLOAD_2     (0, "fload_2",   "...", "...,value"),
	 /*0x25*/ FLOAD_3     (0, "fload_3",   "...", "...,value"),
	 
	 /*0x26*/ DLOAD_0     (0, "dload_0",   "...", "...,value"),
	 /*0x27*/ DLOAD_1     (0, "dload_1",   "...", "...,value"),
	 /*0x28*/ DLOAD_2     (0, "dload_2",   "...", "...,value"),
	 /*0x29*/ DLOAD_3     (0, "dload_3",   "...", "...,value"),
	 
	 /*0x2a*/ ALOAD_0     (0, "aload_0",   "...", "...,objectref"),
	 /*0x2b*/ ALOAD_1     (0, "aload_1",   "...", "...,objectref"),
	 /*0x2c*/ ALOAD_2     (0, "aload_2",   "...", "...,objectref"),
	 /*0x2d*/ ALOAD_3     (0, "aload_3",   "...", "...,objectref"),
	 
	 /*0x2e*/ IALOAD      (0, "iaload",    "...,arrayref,index", "...,value"),
	 /*0x2f*/ LALOAD      (0, "laload",    "...,arrayref,index", "...,value"),
	 /*0x30*/ FALOAD      (0, "faload",    "...,arrayref,index", "...,value"),
	 /*0x31*/ DALOAD      (0, "daload",    "...,arrayref,index", "...,value"),
	 /*0x30*/ AALOAD      (0, "aaload",    "...,arrayref,index", "...,value"),
	 /*0x33*/ BALOAD      (0, "baload",    "...,arrayref,index", "...,value"),
	 /*0x34*/ CALOAD      (0, "caload",    "...,arrayref,index", "...,value"),
	 /*0x35*/ SALOAD      (0, "saload",    "...,arrayref,index", "...,value"),
	 
	 /*0x36*/ ISTORE      (1, "istore",    "...,value",          "..."),
	 /*0x37*/ LSTORE      (1, "lstore",    "...,value",          "..."),
	 /*0x38*/ FSTORE      (1, "fstore",    "...,value",          "..."),
	 /*0x39*/ DSTORE      (1, "dstore",    "...,value",          "..."),
	 /*0x3a*/ ASTORE      (1, "astore",    "...,objectref",      "..."),
	 
	 /*0x3b*/ ISTORE_0    (0, "istore_0",  "...,value", "..."),
	 /*0x3c*/ ISTORE_1    (0, "istore_1",  "...,value", "..."),
	 /*0x3d*/ ISTORE_2    (0, "istore_2",  "...,value", "..."),
	 /*0x3e*/ ISTORE_3    (0, "istore_3",  "...,value", "..."),
	 
	 /*0x3f*/ LSTORE_0    (0, "lstore_0",  "...,value", "..."),
	 /*0x40*/ LSTORE_1    (0, "lstore_1",  "...,value", "..."),
	 /*0x41*/ LSTORE_2    (0, "lstore_2",  "...,value", "..."),
	 /*0x42*/ LSTORE_3    (0, "lstore_3",  "...,value", "..."),
	 
	 /*0x43*/ FSTORE_0    (0, "fstore_0",  "...,value", "..."),
	 /*0x44*/ FSTORE_1    (0, "fstore_1",  "...,value", "..."),
	 /*0x45*/ FSTORE_2    (0, "fstore_2",  "...,value", "..."),
	 /*0x46*/ FSTORE_3    (0, "fstore_3",  "...,value", "..."),
	 
	 /*0x47*/ DSTORE_0    (0, "dstore_0",  "...,value", "..."),
	 /*0x48*/ DSTORE_1    (0, "dstore_1",  "...,value", "..."),
	 /*0x49*/ DSTORE_2    (0, "dstore_2",  "...,value", "..."),
	 /*0x4a*/ DSTORE_3    (0, "dstore_3",  "...,value", "..."),
	 
	 /*0x4b*/ ASTORE_0    (0, "astore_0",  "...,objectref", "..."),
	 /*0x4c*/ ASTORE_1    (0, "astore_1",  "...,objectref", "..."),
	 /*0x4d*/ ASTORE_2    (0, "astore_2",  "...,objectref", "..."),
	 /*0x4e*/ ASTORE_3    (0, "astore_3",  "...,objectref", "..."),
	 
	 /*0x4f*/ IASTORE     (0, "iastore",   "...,arrayref,index,value", "..."),
	 /*0x50*/ LASTORE     (0, "lastore",   "...,arrayref,index,value", "..."),
	 /*0x51*/ FASTORE     (0, "fastore",   "...,arrayref,index,value", "..."),
	 /*0x52*/ DASTORE     (0, "dastore",   "...,arrayref,index,value", "..."),
	 /*0x52*/ AASTORE     (0, "aastore",   "...,arrayref,index,value", "..."),
	 /*0x54*/ BASTORE     (0, "bastore",   "...,arrayref,index,value", "..."),
	 /*0x55*/ CASTORE     (0, "castore",   "...,arrayref,index,value", "..."),
	 /*0x56*/ SASTORE     (0, "sastore",   "...,arrayref,index,value", "..."),
	 
	 /*0x57*/ POP         (0, "pop",       "...,value",         "..."),
	 /*0x58*/ POP2        (0, "pop2",      "...,value2,value1", "..."),
	 
	 /*0x59*/ DUP         (0, "dup",       "...,value",                       "...,value,value"),
	 /*0x5a*/ DUP_X1      (0, "dup_x1",    "...,value2,value1",               "...,value1,value2,value1"),
	 /*0x5b*/ DUP_X2      (0, "dup_x2",    "...,vlue3,value2,value1",         "...,value1,value3,value2,value1"),
	 /*0x5c*/ DUP2        (0, "dup2",      "...,value2,value1",               "...,value2,value1,value2,value1"),
	 /*0x5d*/ DUP2_X1     (0, "dup2_x1",   "...,value3,value2,value1",        "...,value2,value1,value3,value2,value1"),
	 /*0x5e*/ DUP2_X2     (0, "dup2_x2",   "...,value4,value3,value2,value1", "...,value2,value1,value4,value3,value2,value1"),
	 
	 /*0x5f*/ SWAP        (0, "swap", "value2,value1", "value1,value2"),
	 
	 /*0x60*/ IADD        (0, "iadd", "..,value1,value2",   "...,result"),
	 /*0x61*/ LADD        (0, "ladd", "..,value1,value2",   "...,result"),
	 /*0x62*/ FADD        (0, "fadd", "..,value1,value2",   "...,result"),
	 /*0x63*/ DADD        (0, "dadd", "..,value1,value2",   "...,result"),
	 
	 /*0x64*/ ISUB        (0, "isub", "...,value1,value2",  "...,result"),
	 /*0x65*/ LSUB        (0, "lsub", "...,value1,value2",  "...,result"),
	 /*0x66*/ FSUB        (0, "fsub", "...,value1,value2",  "...,result"),
	 /*0x67*/ DSUB        (0, "dsub", "...,value1,value2",  "...,result"),
	 
	 /*0x68*/ IMUL        (0, "imul", "...,value1,value2",  "...,result"),
	 /*0x69*/ LMUL        (0, "lmul", "...,value1,value2",  "...,result"),
	 /*0x6a*/ FMUL        (0, "fmul", "...,value1,value2",  "...,result"),
	 /*0x6b*/ DMUL        (0, "dmul", "...,value1,value2",  "...,result"),
	 
	 /*0x6c*/ IDIV        (0, "idiv", "...,value1,value2",  "...,result"),
	 /*0x6d*/ LDIV        (0, "ldiv", "...,value1,value2",  "...,result"),
	 /*0x6e*/ FDIV        (0, "fdiv", "...,value1,value2",  "...,result"),
	 /*0x6f*/ DDIV        (0, "ddiv", "...,value1,value2",  "...,result"),
	 
	 /*0x70*/ IREM        (0, "irem", "...,value1,value2",  "...,result"),
	 /*0x71*/ LREM        (0, "lrem", "...,value1,value2",  "...,result"),
	 /*0x72*/ FREM        (0, "frem", "...,value1,value2",  "...,result"),
	 /*0x73*/ DREM        (0, "drem", "...,value1,value2",  "...,result"),
	 /*0x74*/ INEG        (0, "ineg", "...,value",          "...,result"),
	 /*0x75*/ LNEG        (0, "lneg", "...,value",          "...,result"),
	 /*0x76*/ FNEG        (0, "fneg", "...,value",          "...,result"),
	 /*0x77*/ DNEG        (0, "dneg", "...,value",          "...,result"),
	 
	 /*0x78*/ ISHL        (0, "ishl", "...,value1,value2",  "...,result"),
	 /*0x79*/ LSHL        (0, "lshl", "...,value1,value2",  "...,result"),
	 /*0x7a*/ ISHR        (0, "ishr", "...,value1,value2",  "...,result"),
	 /*0x7b*/ LSHR        (0, "lshr", "...,value1,value2",  "...,result"),
	 
	 /*0x7c*/ IUSHR       (0, "iushr", "...,value1,value2", "...,result"),
	 /*0x7d*/ LUSHR       (0, "lushr", "...,value1,value2", "...,result"),
	 
	 /*0x7e*/ IAND        (0, "iand", "...,value1,value2",  "...,result"),
	 /*0x7f*/ LAND        (0, "land", "...,value1,value2",  "...,result"),
	 
	 /*0x80*/ IOR         (0, "ior", "...,value1,value2",   "...,result"),
	 /*0x81*/ LOR         (0, "lor", "...,value1,value2",   "...,result"),
	 
	 /*0x82*/ IXOR        (0, "ixor", "...,value1,value2",  "...,result"),
	 /*0x83*/ LXOR        (0, "lxor", "...,value1,value2",  "...,result"),
	 /*0x84*/ IINC        (2, "iinc", "",                   ""),
	 
	 /*0x85*/ I2L         (0, "i2l", "...,value", "...,result"),
	 /*0x86*/ I2F         (0, "i2f", "...,value", "...,result"),
	 /*0x87*/ I2D         (0, "i2d", "...,value", "...,result"),
	 
	 /*0x88*/ L2I         (0, "l2i", "...,value", "...,result"),
	 /*0x89*/ L2f         (0, "l2f", "...,value", "...,result"),
	 /*0x8a*/ L2D         (0, "l2d", "...,value", "...,result"),
	 
	 /*0x8b*/ F2I         (0, "f2i", "...,value", "...,result"),
	 /*0x8c*/ F2L         (0, "f2l", "...,value", "...,result"),
	 /*0x8d*/ F2D         (0, "f2d", "...,value", "...,result"),
	 
	 /*0x8e*/ D2I         (0, "d2i", "...,value", "...,result"),
	 /*0x8f*/ D2L         (0, "d2l", "...,value", "...,result"),
	 /*0x90*/ D2F         (0, "d2f", "...,value", "...,result"),
	 
	 /*0x91*/ I2B         (0, "i2b",   "...,value",         "...,result"),
	 /*0x92*/ I2C         (0, "i2c",   "...,value",         "...,result"),
	 /*0x93*/ I2S         (0, "i2s",   "...,value",         "...,result"),
	 /*0x94*/ LCMP        (0, "lcmp",  "...,value1,value2", "...,result"),
	 /*0x95*/ FCMPL       (0, "fcmpl", "...,value1,value2", "...,result"),
	 /*0x96*/ FCMPG       (0, "fcmpg", "...,value1,value2", "...,result"),
	 
	 /*0x97*/ DCMPL       (0, "dcmpl", "...,value1,value2", "...,resut"),
	 /*0x98*/ DCMPG       (0, "dcmpg", "...,value1,value2", "...,resut"),
	 
	 /*0x99*/ IFEQ        (2, "ifeq",      "...,value",         "..."),
	 /*0x9a*/ IFNE        (2, "ifne",      "...,value",         "..."),
	 /*0x9b*/ IFLT        (2, "iflt",      "...,value",         "..."),
	 /*0x9c*/ IFGE        (2, "ifge",      "...,value",         "..."),
	 /*0x9d*/ IFGT        (2, "ifgt",      "...,value",         "..."),
	 /*0x9e*/ IFLE        (2, "ifle",      "...,value",         "..."),
	 /*0x9f*/ IF_ICMPEQ   (2, "if_icmpeq", "...,value1,value2", "..."),
	 /*0xa0*/ IF_ICMPE    (2, "if_icmpne", "...,value1,value2", "..."),
	 /*0xa1*/ IF_ICMPLT   (2, "if_icmplt", "...,value1,value2", "..."),
	 /*0xa2*/ IF_ICMPGE   (2, "if_icmpge", "...,value1,value2", "..."),
	 /*0xa3*/ IF_ICMPGT   (2, "if_icmpgt", "...,value1,value2", "..."),
	 /*0xa4*/ IF_ICMPLE   (2, "if_icmple", "...,value1,value2", "..."),
	 /*0xa5*/ IF_ACMPEQ   (2, "if_acmpeq", "...,value1,value2", "..."),
	 /*0xa6*/ IF_ACMPNE   (2, "if_acmpne", "...,value1,value2", "..."),
	 
	 /*0xa7*/ GOTO        (2, "goto",         "",          ""),
	 /*0xa8*/ JSR         (2, "jsr",          "...",       "...,address"),
	 /*0xa9*/ RET         (1, "ret",          "",          ""),
	 /*0xaa*/ TABLESSWITCH(12, "tableswitch", "...,index", "..."),
	 /*0xab*/ LOOKUPSWITCH(8, "lookupswitch", "...,key",   "..."),
	 
	 /*0xac*/ IRETURN     (0, "ireturn", "...,value",     "[empty]"),
	 /*0xad*/ LRETURN     (0, "lreturn", "...,value",     "[empty]"),
	 /*0xae*/ FRETURN     (0, "freturn", "...,value",     "[empty]"),
	 /*0xaf*/ DRETURN     (0, "dreturn", "...,value",     "[empty]"),
	 /*0xb0*/ ARETURN     (0, "areturn", "...,objectref", "[empty]"),
	 /*0xb1*/ RETURN      (0, "return",  "...",           "[empty]"),
	 
	 /*0xb2*/ GETSTATIC   (2, "getstatic", "...",                 "...,value"),
	 /*0xb3*/ PUTSTATIC   (2, "putstatic", "...,value",           "..."),
	 /*0xb4*/ GETFIELD    (2, "getfield",  "...,objectref",       "...,value"),
	 /*0xb5*/ PUTFIELD    (2, "putfield",  "...,objectref,value", "..."),
	 
	 /*0xb6*/ INVOKEVIRTUAL   (2, "invokevirtual",   "...,objectref,[arg1,[arg2...]]", "..."),
	 /*0xb7*/ INVOKESPECIAL   (2, "invokespecial",   "...,objectref,[arg1,[arg2...]]", "..."),
	 /*0xb8*/ INVOKESTATIC    (2, "invokestatic",    "...,[arg1,[arg2...]]",           "..."),
	 /*0xb9*/ INVOKEINTERFACE (4, "invokeinterface", "...,objectref,[arg1,[arg2...]]", "..."),
	 /*0xba*/ UNUSED          (0, "xxxunusedxxx1",   "",                               ""),
	 
	 /*0xbb*/ NEW            (2, "new",            "...",                     "...,objectref"),
	 /*0xbc*/ NEWARRAY       (1, "newarray",       "...,count",               "...,arrayref"),
	 /*0xbd*/ ANEWARRAY      (2, "anewarray",      "...,count",               "...,arrayref"),
	 /*0xbe*/ ARRAYLENGHT    (0, "arraylength",    "...,arrayref",            "...,length"),
	 /*0xbf*/ ATHROW         (0, "athrow",         "...,objectref",           "objectref"),
	 /*0xc0*/ CHECKCAST      (2, "checkcast",      "...,objectref",           "...,objectref"),
	 /*0xc1*/ INSTANCEOF     (2, "instanceof",     "...,objectref",           "...,result"),
	 /*0xc2*/ MONITORENTER   (0, "monitorenter",   "...objectref",            "..."),
	 /*0xc3*/ MONITOREXIT    (0, "monitorexit",    "...objectref",            "..."),
	 /*0xc4*/ WIDE           (0, "wide",           "",                        ""), // TODO: fill elements and stack status 
	 /*0xc5*/ MULTIANEWARRAY (3, "multianewarray", "...,count1,[count2,...]", "...,arrayref"),
	 /*0xc6*/ IFNULL         (2, "ifnull",         "...,value",               "..."),
	 /*0xc7*/ IFNONNULL      (2, "ifnonnull",      "...,value",               "..."),
	 /*0xc8*/ GOTO_W         (4, "goto_w",         "",                        ""),
	 /*0xc9*/ JSR_W          (4, "jsr_w",          "...",                     "...,address");

//	 BREAKPOINT     (0xca, 0, "breakpoint", "", ""),
//	 IMPDEP1        (0xfe, 0, "impdep1", "", ""),
//	 IMPDEP2        (0xff, 0, "impdep2", "", "");
	
	 private final int elements;
	 private final String name;
	 private final String stackBefore, stackAfter;
	 
	 public static final int COUNT = 0xc9;
	 	 
	 Opcode(int elements, String name, String stackBefore, String stackAfter) {
		 this.elements   = elements;
		 this.name       = name;
		 this.stackBefore= stackBefore;
		 this.stackAfter = stackAfter;
	 }
	 
	 public String getName() {
		 return name;
	 }
	 
	public int getElements() {
		return elements;
	}
	
	public String getStackAfter() {
		return stackAfter;
	}
	
	public String getStackBefore() {
		return stackBefore;
	}
	 
}
